<template>
  <!-- 由于官方预编译的文件有错误使用npm引入无法显示样式，故暂且使用cdn引入 -->
  <link rel="stylesheet" href="https://unpkg.com/element-plus/lib/theme-chalk/index.css">
  <el-affix position="top" :offset="0" >
    <NavTop></NavTop>
  </el-affix>
  <div style="margin:0 5em;" class="anchor-for-backtop">
    <router-view></router-view>
    <el-backtop target=".anchor-for-backtop" :bottom="100">
      <i class="el-icon-caret-top"></i>
    </el-backtop>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import NavTop from './components/NavTop.vue'
export default defineComponent({
  name: 'App',
  components: {
    NavTop
  },
  mounted(){
    window.onbeforeunload=function(e){
      window.localStorage.clear()
    }
  }
})
</script>

<style scoped>
  #app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    /* margin-top: 60px; */
  }
</style>

<style>
a:link {
  text-decoration: none;
}
/* a:visited{
  color: paleturquoise;
} */
/* a:active{
  color:orange
} */
.my-tag {
  margin: 0.2em 0.5em; /*先纵向再横向间隔 */
}
</style>
